addStyleImage

abstract fun addStyleImage(@NonNull() imageId: String, scale: Float, @NonNull() image: Image, sdf: Boolean, @NonNull() stretchX: List<ImageStretches>, @NonNull() stretchY: List<ImageStretches>, @Nullable() content: ImageContent): Expected<String, None>

Adds an image to be used in the style. This API can also be used for updatingan image. If the image for a given `imageId` was already added, it gets replaced by the new image.The image can be used in [`icon-image`](https://www.mapbox.com/mapbox-gl-js/style-spec/#layout-symbol-icon-image),[`fill-pattern`](https://www.mapbox.com/mapbox-gl-js/style-spec/#paint-fill-fill-pattern),[`line-pattern`](https://www.mapbox.com/mapbox-gl-js/style-spec/#paint-line-line-pattern) and[`text-field`](https://www.mapbox.com/mapbox-gl-js/style-spec/#layout-symbol-text-field) properties.

Return

A string describing an error if the operation was not successful, empty otherwise.

Parameters

imageId

An identifier of the image.

scale

A scale factor for the image.

image

A pixel data of the image.

sdf

An option to treat whether image is SDF(signed distance field) or not.

stretchX

An array of two-element arrays, consisting of two numbers that representthe from position and the to position of areas that can be stretched horizontally.

stretchY

An array of two-element arrays, consisting of two numbers that representthe from position and the to position of areas that can be stretched vertically.

content

An array of four numbers, with the first two specifying the left, topcorner, and the last two specifying the right, bottom corner. If present, and if theicon uses icon-text-fit, the symbol's text will be fit inside the content box.